package com.hangjiang.gulidear.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

/**
 * User entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "user", catalog = "sqm")
public class User extends BaseEntity {

	// Fields

	private String userId;
	private Resume resume;
	private Department department;
	private String userName;
	private String loginPwd;
	private String cellPhone;
	private String email;
	private Set<Task> tasksForExecutionUserId = new HashSet<Task>(0);
	private Set<Meeting> meetings = new HashSet<Meeting>(0);
	private Set<Project> projects = new HashSet<Project>(0);
	private Set<ConfigItem> configitems = new HashSet<ConfigItem>(0);
	private Set<ConfigChange> configchanges = new HashSet<ConfigChange>(0);
	private Set<ChangeAudit> changeaudits = new HashSet<ChangeAudit>(0);
	private Set<Code> codes = new HashSet<Code>(0);
	private Set<Task> tasksForCreateUserId = new HashSet<Task>(0);
	private Set<Problem> problemsForCuserId = new HashSet<Problem>(0);
	private Set<ExtraWorkApplication> extraworkapplications = new HashSet<ExtraWorkApplication>(
			0);
	private Set<IssueEvalue> issueevalues = new HashSet<IssueEvalue>(0);
	private Set<Bug> bugs = new HashSet<Bug>(0);
	private Set<Problem> problemsForExeUserId = new HashSet<Problem>(0);
	private Set<Comment> comments = new HashSet<Comment>(0);
	private Set<UserRole> userRoles = new HashSet<UserRole>(0);
	private Set<Bug> bugs_1 = new HashSet<Bug>(0);
	private Set<ConfigIssue> configissues = new HashSet<ConfigIssue>(0);

	// Constructors

	/** default constructor */
	public User() {
	}

	/** full constructor */
	public User(Resume resume, Department department, String userName,
			String loginPwd, String cellPhone, String email) {
		this.resume = resume;
		this.department = department;
		this.userName = userName;
		this.loginPwd = loginPwd;
		this.cellPhone = cellPhone;
		this.email = email;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "userId", unique = true, nullable = false, length = 32)
	public String getUserId() {
		return this.userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "resumeId")
	public Resume getResume() {
		return this.resume;
	}

	public void setResume(Resume resume) {
		this.resume = resume;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "deptId")
	public Department getDepartment() {
		return this.department;
	}

	public void setDepartment(Department department) {
		this.department = department;
	}

	@Column(name = "userName", length = 30)
	public String getUserName() {
		return this.userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	@Column(name = "loginPwd", length = 50)
	public String getLoginPwd() {
		return this.loginPwd;
	}

	public void setLoginPwd(String loginPwd) {
		this.loginPwd = loginPwd;
	}

	@Column(name = "cellPhone", length = 16)
	public String getCellPhone() {
		return this.cellPhone;
	}

	public void setCellPhone(String cellPhone) {
		this.cellPhone = cellPhone;
	}

	@Column(name = "eMail", length = 50)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "userByExecutionUserId")
	public Set<Task> getTasksForExecutionUserId() {
		return this.tasksForExecutionUserId;
	}

	public void setTasksForExecutionUserId(Set<Task> tasksForExecutionUserId) {
		this.tasksForExecutionUserId = tasksForExecutionUserId;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	public Set<Meeting> getMeetings() {
		return this.meetings;
	}

	public void setMeetings(Set<Meeting> meetings) {
		this.meetings = meetings;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	public Set<Project> getProjects() {
		return this.projects;
	}

	public void setProjects(Set<Project> projects) {
		this.projects = projects;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	public Set<ConfigItem> getConfigitems() {
		return this.configitems;
	}

	public void setConfigitems(Set<ConfigItem> configitems) {
		this.configitems = configitems;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	public Set<ConfigChange> getConfigchanges() {
		return this.configchanges;
	}

	public void setConfigchanges(Set<ConfigChange> configchanges) {
		this.configchanges = configchanges;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	public Set<ChangeAudit> getChangeaudits() {
		return this.changeaudits;
	}

	public void setChangeaudits(Set<ChangeAudit> changeaudits) {
		this.changeaudits = changeaudits;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	public Set<Code> getCodes() {
		return this.codes;
	}

	public void setCodes(Set<Code> codes) {
		this.codes = codes;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "userByCreateUserId")
	public Set<Task> getTasksForCreateUserId() {
		return this.tasksForCreateUserId;
	}

	public void setTasksForCreateUserId(Set<Task> tasksForCreateUserId) {
		this.tasksForCreateUserId = tasksForCreateUserId;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "userByCuserId")
	public Set<Problem> getProblemsForCuserId() {
		return this.problemsForCuserId;
	}

	public void setProblemsForCuserId(Set<Problem> problemsForCuserId) {
		this.problemsForCuserId = problemsForCuserId;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	public Set<ExtraWorkApplication> getExtraworkapplications() {
		return this.extraworkapplications;
	}

	public void setExtraworkapplications(
			Set<ExtraWorkApplication> extraworkapplications) {
		this.extraworkapplications = extraworkapplications;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	public Set<IssueEvalue> getIssueevalues() {
		return this.issueevalues;
	}

	public void setIssueevalues(Set<IssueEvalue> issueevalues) {
		this.issueevalues = issueevalues;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	public Set<Bug> getBugs() {
		return this.bugs;
	}

	public void setBugs(Set<Bug> bugs) {
		this.bugs = bugs;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "userByExeUserId")
	public Set<Problem> getProblemsForExeUserId() {
		return this.problemsForExeUserId;
	}

	public void setProblemsForExeUserId(Set<Problem> problemsForExeUserId) {
		this.problemsForExeUserId = problemsForExeUserId;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	public Set<Comment> getComments() {
		return this.comments;
	}

	public void setComments(Set<Comment> comments) {
		this.comments = comments;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	public Set<UserRole> getUserRoles() {
		return this.userRoles;
	}

	public void setUserRoles(Set<UserRole> userRoles) {
		this.userRoles = userRoles;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	public Set<Bug> getBugs_1() {
		return this.bugs_1;
	}

	public void setBugs_1(Set<Bug> bugs_1) {
		this.bugs_1 = bugs_1;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	public Set<ConfigIssue> getConfigissues() {
		return this.configissues;
	}

	public void setConfigissues(Set<ConfigIssue> configissues) {
		this.configissues = configissues;
	}

}